{template 'common/header'}
<ul class="nav nav-tabs">

    <li {if $operation=='display'}class="active"{/if}><a
        href="{php echo $this->createWebUrl('userMsg', array('op' => 'display','bid'=>$bid));}">留言管理</a></li>

    <li ><a
            href="{php echo $this->createWebUrl('brand', array( 'op' => 'display'));}">品牌管理</a></li>

</ul>

{if $operation == 'edit'}

<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h4>&nbsp;&nbsp;&nbsp;{$brand['bname']} 用户留言</h4>
        </div>
        <div class="panel-body">

            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">用户名</label>
                <div class="col-sm-9 col-xs-12">
                    <input type="text" name="title" class="form-control"
                           value="{$item['name']}"/>
                </div>
            </div>


            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">地址</label>

                <div class="col-sm-9 col-xs-12">
                    <input type="text" name="address" class="form-control"
                           value="{$item['address']}"/>
                </div>
            </div>



            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">电话</label>

                <div class="col-sm-9 col-xs-12">
                    <input type="text" name="tel" class="form-control"
                           value="{$item['tel']}"/>
                </div>
            </div>



            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">留言内容</label>

                <div class="col-sm-9 col-xs-12">
					<textarea style="height: 400px; width: 100%;" class="span7"
                              name="note" cols="70">{$item['content']}</textarea>
                </div>
            </div>


        </div>

    </div>
    </form>
{elseif $operation == 'display'}
<div class="main">
    <a href="{php echo $this->createWebUrl('userDownload', array('bid'=>$brand['id']))}"
       class="btn btn-large btn-primary">下载用户数据</a>

    <div class="panel panel-default">
        <div class="table-responsive panel-body">

        <table class="table table-hover">
            <thead class="navbar-inner">
            <tr>
                <th style="min-width: 150px;">用户名</th>
                <th style="min-width: 150px;">地址</th>
                <th style="width: 200px;">电话</th>

                <th style="width: 200px;">留言时间</th>

                <th style="text-align: right; min-width: 60px;">操作</th>
            </tr>
            </thead>
            <tbody>
            {loop $list $item}
            <tr>
                <td>{$item['name']}</td>
                <td>{$item['address']}</td>
                <td>{$item['tel']}</td>
                <td>{php echo date('Y-m-d H:i', $item['createtime'])}</td>

                <td style="text-align: right; width: 300px"><a
                        href="{php echo $this->createWebUrl('userMsg', array( 'id' => $item['id'], 'op' => 'edit','bid'=>$bid))}"
                        title="编辑" class="btn btn-small"><i class="glyphicon glyphicon-edit"></i>查看</a> <a
                        href="{php echo $this->createWebUrl('userMsg', array('id' => $item['id'], 'op' => 'delete','bid'=>$bid))}"
                        onclick="return confirm('此操作不可恢复，确认删除？');return false;" title="删除"
                        class="btn btn-small"><i class="glyphicon glyphicon-remove"></i>删除</a></td>
            </tr>
            {/loop}
            </tbody>

        </table>
</div>
    </div>
</div>
{/if} {template 'common/footer'}
